// Car/ Background View

(function( window, undefined ) {

var Background = Class({
	name: "Background",
	parent: "View",
	constructor: function() {
		var _info = null;
		var _$object = $("<div class='background'></div>");
		var _flow = false;
		
		return {
			__construct: function( info ) {
				console.log( this, "__construct" );
				
				_info = info;
			},
			
			object:function() {
				return _$object;
			},
			
			flow: function() {
				var x = parseInt( _$object.css( "background-position-x" ) ) * -1;
				var speed = _info.speed();
				
				x = x + speed;
				
				if ( x > 1200 ) {
					x = x - 1200;
				};
				
				_$object.css( "background-position-x", (x*-1) );
			},
			
			update: function( ) {
				
			}
		}
	}
});

Class.View.Background = Background;

})();